import socket

sk = socket.socket()

# set connection
sk.connect(('127.0.0.1', 6666))

while True:
  message = input('please input message(q is quit, cd is menu):')
  if message == 'q':
    sk.sendall(bytes(message, encoding='utf-8'))
    break
  else:
    sk.sendall(bytes(message, encoding='utf-8'))
    ret = str(sk.recv(1024), encoding='utf-8')
    print(ret)

sk.close()
